# @Time : 2021/6/20 9:52
# @Author : Li Kunlun
# @Description : 优化


my_list = [11, 12, 13]
my_tuple = (21, 22, 23)
# zip() 函数用于将可迭代的对象作为参数，将对象中对应的元素打包成一个个元组，然后返回由这些元组组成的列表。
# [(11, 21), (12, 22), (13, 23)]
print([x for x in zip(my_list, my_tuple)])

print("---------------zip传入三个数据进行c测试-----------------------")
test1 = [1, 2, 3]
test2 = [4, 5, 6]
test3 = [7, 8, 9]
# [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
print([x for x in zip(test1, test2, test3)])

for x1, x2, x3 in zip(test1, test2, test3):
    # 1 4 7
    # 2 5 8
    # 3 6 9
    print(x1, x2, x3)
